x86/MCE: add more strict sanity check of one SRAR case
authorLiu, Jinsong <jinsong.liu@intel.com>
Thu, 15 Dec 2011 09:58:53 +0000 (10:58 +0100)
committerLiu, Jinsong <jinsong.liu@intel.com>
Thu, 15 Dec 2011 09:58:53 +0000 (10:58 +0100)
When RIPV = EIPV = 0, it's a little bit tricky. It may be an asynchronic error, currently we have no way to precisely locate whether the error occur at guest or hypervisor.
To avoid handling error in wrong way, we treat it as unrecovered.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/cpu/mcheck/mce_intel.c

index 1b941f41e32f55df40d5228e39b259d32831fbeb..0986025a8d698e5b0a3f77770de665d9e48d461c 100644 (file)
@@ -375,8 +375,18 @@ static int mce_urgent_action(struct cpu_user_regs *regs,
         return 0;
 
     gstatus = mca_rdmsr(MSR_IA32_MCG_STATUS);
-    /* Xen is not pre-emptible */
-    if ( !(gstatus & MCG_STATUS_RIPV) && !guest_mode(regs))
+
+    /*
+     * FIXME: When RIPV = EIPV = 0, it's a little bit tricky. It may be an
+     * asynchronic error, currently we have no way to precisely locate
+     * whether the error occur at guest or hypervisor.
+     * To avoid handling error in wrong way, we treat it as unrecovered.
+     *
+     * Another unrecovered case is RIPV = 0 while in hypervisor
+     * since Xen is not pre-emptible.
+     */
+    if ( !(gstatus & MCG_STATUS_RIPV) &&
+         (!(gstatus & MCG_STATUS_EIPV) || !guest_mode(regs)) )
         return -1;
 
     return mce_action(regs, mctc) == MCER_RESET ? -1 : 0;